<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<%@ include file="header.jsp"%>

<script type="text/javascript">
	$(document).ready(function() {
		initCKeditor();
		fetchBlogPostById('#fetch-blog-post');
		editDialog();
		$(".datepicker").datepicker();
		startTime();
		fetchTagsAssociatedWithPost();
		$("#del-post").button();
		fetchCommentsByPostId();
		$("#submit-comment").button();
		canEnterCommentText();
		resetCommentForm();
	})
	
	
</script>

<body onload="prettyPrint()">
	<%@ include file="navigation.jsp"%>
	<div class="body-wrapper">
		<div id="inner-wrapper" class="group main-cotent">
			<%@ include file="blog-aside.jsp"%>
			<section id="fetch-blog-post" class="section-home blog-section">
				<div id="loading">
					Loading... <img src="images/ajax-loader.gif" />
				</div>		
			</section>
			<a name="comments-link"></a>
			<section id="fetch-comments" class="section-home blog-section">
				<div id="all-comments">
					<div id="loading-comments">
						Loading... <img src="images/ajax-loader.gif" />
					</div>
				</div>
				<div id="post-comment">
					<p class="comment-title">Share your Thoughts:</p>
					<p class="post-success"></p>
					<form id="comment-form">
						<input id="c-name" type="text" name="name" placeholder="Your Name"
							value="${sessionScope.username}"
							onclick="javascript:resetCommentName()" /> <span><font
							color="red">*</font>(Required)</span> <input id="c-email" type="email"
							name="email" placeholder="Your Email"
							value="${sessionScope.email}"
							onclick="javascript:resetCommentEmail()" /> <span><font
							color="red">*</font>(Required, but never disclosed)</span> <input
							id="c-url" type="url" name="url" placeholder="Your Website" />
						<textarea id="c-text" name="commentText"
							placeholder="Share Your Thoughts ..." cols="40" rows="10"
							onclick="javascript:resetCommentContent()"></textarea>
					</form>
					<p class="form-allowed-tags">
						You may use these <abbr title="HyperText Markup Language">HTML</abbr>
						tags and attributes: &lt;a href="" title=""&gt; &lt;abbr
						title=""&gt; &lt;acronym title=""&gt; &lt;b&gt; &lt;blockquote
						cite=""&gt; &lt;code&gt; &lt;em&gt; &lt;i&gt; &lt;q cite=""&gt;
						&lt;strike&gt; &lt;strong&gt;
					</p>
					<button id="submit-comment" onclick="javascript:addComment();">Submit</button>
					<div class="hints">
						<c:if test="${empty sessionScope.username}">
							<p>Sorry, you are not signed in.</p>
							<p>
								To avoid spam, you have <span id="left-characters">200</span>
								characters left in comments.
							</p>
						</c:if>
					</div>
			</section>
			<div class="controls">
				<p class="post-action"></p>
				<c:if test="${isAdmin}">
					<button id="edit-post">Edit</button>
					<button id="del-post">Delete</button>
				</c:if>
			</div>
			<div id="edit-form" title="Edit a Post">
				<p class="validateTips">All form fields are required.</p>
				<form>
					<fieldset>
						<label class="form-style" for="postTitle">Title:</label> <input
							id="title" name="title" type="text" size="60" />
						<div id="tags"></div>
						<label class="form-style" for="postContent">Edit Your Blog
							Post:</label>
						<textarea id="postTextArea" name="postTextArea" cols="10"
							rows="10" class="text ui-widget-content ui-corner-all"></textarea>
					</fieldset>
				</form>
			</div>
		</div>
	</div>
	<%@ include file="footer.jsp"%>
</body>